<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron text-center" style="margin-bottom:0">
    <p>惊喜</p>
    <button onclick="sh()">
        点击获取惊喜礼包
    </button>
</div>
</body>
<script>
    let arr = [
        [1, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22],
        [2, 8, 12, 18, 22],
        [3, 7, 12, 13, 14, 15, 16, 18, 22],
        [4, 6, 16, 18, 22],
        [5, 5, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22],
    ];

    function sh() {
        demo(arr);
    }
    function demo(arr) {
        let str = "";
        for (let i = 0; i < arr.length; i++) {
            for (j = 0; j < 30; j++) {
                if (arr[i].indexOf(j) > -1) {
                    str += "█";
                } else {
                    str += " ";
                }
            }
            str += "\n";
        }
        return str;
    }
    console.log(demo(arr));
</script>
</html>